/**
 * 
 */
package ucb.laboratorio3.doenca.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


/**
 * @author Gustavo. G. Martinelli UC05001333
 *
 */
public class Banco {
	
	private final String USER = "discon";
	private final String PASS = "discon";
	private final String DRIVER = "com.mysql.jdbc.Driver";
	private final String ENDERECO = "jdbc:mysql://localhost:3306/discon";
	private Connection conexao;
	
	public Banco()
	{
		try {
			Class.forName(DRIVER);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public void conecta()
	{
		try {
			this.setConexao(DriverManager.getConnection(this.ENDERECO, this.USER, this.PASS));
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	/**
	 * @return the con
	 */
	public Connection getConexao() {
		return conexao;
	}

	/**
	 * @param con the con to set
	 */
	public void setConexao(Connection con) {
		this.conexao = con;
	}
	
	
	
}
